range: Hide internals from accessibility
authorMatthias Clasen <mclasen@redhat.com>
Wed, 21 Oct 2020 12:00:09 +0000 (08:00 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 21 Oct 2020 12:01:25 +0000 (08:01 -0400)
The nameless, faceless gizmos inside a range do not
contribute to the accessible experience at all, lets
not add them to the tree. All the accessible functionality
is on the main widget (either a scale or a scrollbar).

gtk/gtkrange.c

index 6b9ead4fd0c50c9d18c94e74f161f5c710f89616..650a9e292e9d1f92fc1967314e33379c80080e65 100644 (file)
@@ -529,12 +529,13 @@ gtk_range_init (GtkRange *range)
 
   gtk_widget_update_orientation (GTK_WIDGET (range), priv->orientation);
 
-  priv->trough_widget = gtk_gizmo_new ("trough",
-                                       gtk_range_measure_trough,
-                                       gtk_range_allocate_trough,
-                                       gtk_range_render_trough,
-                                       NULL,
-                                       NULL, NULL);
+  priv->trough_widget = gtk_gizmo_new_with_role ("trough",
+                                                 GTK_ACCESSIBLE_ROLE_NONE,
+                                                 gtk_range_measure_trough,
+                                                 gtk_range_allocate_trough,
+                                                 gtk_range_render_trough,
+                                                 NULL,
+                                                 NULL, NULL);
 
   gtk_widget_set_parent (priv->trough_widget, GTK_WIDGET (range));